home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 1 #6 / Commodore_Disk_User_Vol.1_6_1988_-.d64 / colour match (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  79 lines

  1. 10 rem ** colour match **
  2. 20 rem ** by d.butcher **
  3. 30 printchr$(142)chr$(8)
  4. 40 poke53280,2:poke53281,2:gosub450
  5. 50 dimcm(16,16,3),c$(16),i$(16),b$(16)
  6. 60 d=d+1:x=0:forc=0to15:readc$(c),i$(c),cm(16,c,d),b$(c):next
  7. 70 forc=0to15:forp=0to15:ifp=cthenr$="0":goto180
  8. 80 b=val(b$(p)):poke53280,c:poke53281,c:x=x+1
  9. 90 print"[147]"tab(9)chr$(b)"combination number "x""
  10. 100 l1=len(c$(p)):l2=len(c$(c)):l=l1+l2
  11. 110 printtab(18-l/2)c$(p)" on "c$(c)
  12. 120 printtab(12)"please enter mark"
  13. 130 printtab(16)"good - 3"
  14. 140 printtab(16)"fair - 2"
  15. 150 printtab(16)"poor - 1"
  16. 160 getr$:ifr$=""then160
  17. 170 ifval(r$)<1orval(r$)>3then90
  18. 180 r=val(r$):ifr<0orr>3then90
  19. 190 ifr=3thencm(c,p,d)=3:goto220
  20. 200 ifr=2thencm(c,p,d)=2:goto220
  21. 210 ifr=1thencm(c,p,d)=1
  22. 220 nextp,c:poke53280,2:poke53281,2
  23. 230 print"[147]"tab(3)"[158]do you wish to see marks (y/n) ? ";
  24. 240 gosub430:ifr$="n"then300
  25. 250 forx=0to15:printtab(8)i$(x)" ";:next:print
  26. 260 forc=0to15:printc$(c)"[145]"
  27. 270 forp=0to15:printtab(7)cm(c,p,d)"[157]";
  28. 280 next:print:next:print
  29. 290 ifd=2then330
  30. 300 printtab(2)"run again for black + white (y/n) ? ";
  31. 310 gosub430:ifr$="n"then330
  32. 320 restore:goto60
  33. 330 print"do you wish to see total marks (y/n) ? ";
  34. 340 gosub430:ifr$="n"then400
  35. 350 print"[147]"tab(14)"total marks":forx=0to15:printtab(8)i$(x)" ";:next:print
  36. 360 forc=0to15:printc$(c)"[145]"
  37. 370 forp=0to15:cm(c,p,3)=cm(c,p,1)+cm(c,p,2)
  38. 380 printtab(7)cm(c,p,3)"[157]";
  39. 390 next:print:next
  40. 400 printtab(11)"run again (y/n) ? ";
  41. 410 gosub430:ifr$="n"thenprintchr$(9):end
  42. 420 run
  43. 430 getr$:ifr$<>"y"andr$<>"n"then430
  44. 440 printr$:print:return
  45. 450 print"[147][158]"tab(14)"colour match"
  46. 460 printtab(14)"[197][197][197][197][197][197][197][197][197][197][197][197]"
  47. 470 print"although the c64 offers a wide selection"
  48. 480 print"of colours, not every combination of two"
  49. 490 print"provides a good match. pairings that are"
  50. 500 print"good for graphics use aren't necessarily"
  51. 510 print"suitable  for  displaying  text. this is"
  52. 520 print"especially noticeable when monochromatic"
  53. 530 print"monitors are used. this program can help"
  54. 540 print"in the selection of colours when writing"
  55. 550 print"basic programs."
  56. 560 gosub690
  57. 570 print"every combination of two colours will be"
  58. 580 print"displayed. you'll be told which  colours"
  59. 590 print"are being used, and asked to give a mark"
  60. 600 print"for each combination. when every pairing"
  61. 610 print"has been shown, you can either run again"
  62. 620 print"for black & white, (remember  to  adjust"
  63. 630 print"your set), or see the marks displayed on"
  64. 640 print"a grid. the colours  won't  change until"
  65. 650 print"you have entered a mark within the range"
  66. 660 print"specified."
  67. 670 gosub710
  68. 680 return
  69. 690 y$=""
  70. 700 y$=y$+"press return to continue"
  71. 710 printy$
  72. 720 getan$:ifan$<>chr$(13)then720
  73. 730 print"[147]":return
  74. 740 datablack,b,0,144,white,w,1,5,red,r,2,28,cyan,c,3,159
  75. 750 datapurple,p,4,156,green,g,5,30,blue,b,6,31
  76. 760 datayellow,y,7,158,orange,o,8,129,brown,b,9,149
  77. 770 datalt.red,r,10,150,gray1,g,11,151,gray2,g,12,152
  78. 780 datalt.grn.,g,13,153,lt.blue,b,14,154,gray3,g,15,155
  79.